package bank.mvc;


import java.awt.*;
import java.util.Map;

public class ReportDialog extends javax.swing.JDialog {

    String billstring;

    public ReportDialog(Frame parent, Map<String, String> map) {
        super(parent);
        setTitle("Report");

        getContentPane().setLayout(null);
        setSize(405, 367);
        setVisible(false);
        getContentPane().add(JScrollPane1);
        JScrollPane1.setBounds(24, 24, 358, 240);
        JScrollPane1.getViewport().add(JTextArea1);
        JTextArea1.setBounds(0, 0, 355, 237);
        JButton_OK.setText("OK");
        JButton_OK.setActionCommand("OK");
        getContentPane().add(JButton_OK);
        JButton_OK.setBounds(156, 276, 96, 24);
        Font font = new Font("Verdana", Font.BOLD, 14);
        JTextArea1.setFont(font);

        StringBuilder bld = new StringBuilder();
        for (Map.Entry<String, String> row : map.entrySet()) {
            bld.append(row.getKey());
            bld.append(" : ");
            bld.append(row.getValue());
            bld.append("\r\n");
        }

        // generate the string for the monthly bill
        JTextArea1.setText(bld.toString());
        //}}

        //{{REGISTER_LISTENERS
        SymAction lSymAction = new SymAction();
        JButton_OK.addActionListener(lSymAction);
        //}}
    }


    javax.swing.JScrollPane JScrollPane1 = new javax.swing.JScrollPane();

    javax.swing.JTextArea JTextArea1 = new javax.swing.JTextArea();

    javax.swing.JButton JButton_OK = new javax.swing.JButton();


    class SymAction implements java.awt.event.ActionListener {
        public void actionPerformed(java.awt.event.ActionEvent event) {
            Object object = event.getSource();
            if (object == JButton_OK)
                JButtonOK_actionPerformed(event);
        }
    }

    void JButtonOK_actionPerformed(java.awt.event.ActionEvent event) {
        dispose();
    }
}
